package exam.demo1;

public class Test6 {

    public static void main(String[] args) {
        StringBuffer ret1 = new StringBuffer();
        StringBuffer ret2 = new StringBuffer();
        ret1.append(('0' + 15 % 10));
        ret2.append((char)('0' + 15 % 10));
        System.out.println(ret1);
        System.out.println(ret2);


    }

    public static String solve (String s, String t)
    {
        StringBuffer ret = new StringBuffer();
        int tmp = 0; // 标记进位 + 本次累加的结果
        int i = s.length() - 1, j = t.length() - 1;
        while(i >= 0 || j >= 0 || tmp > 0) // 模拟加法
        {
            if(i >= 0)
                tmp += s.charAt(i--) - '0';
            if(j >= 0)
                tmp += t.charAt(j--) - '0';

            ret.append(('0' + tmp % 10));
            tmp /= 10;
        }
        return ret.reverse().toString(); // 别忘逆序
    }

    public static String solve1 (String s, String t) {
        // write code here
        int num1 = 0;
        int num2 = 0;
        if (!s.equals("")) {
            num1 = Integer.parseInt(s);

        }
        if (!t.equals("")) {
            num2 = Integer.parseInt(t);
        }

        String str = String.valueOf(num1*num2);
        return str;
    }
}
